﻿using Paas.Core.Sys.Entities;
using Basefr.Attributes;
using Basefr.Core.Entities;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Paas.Core.Common.Entities
{
    /// <summary>
    /// 新闻公告
    /// </summary>
    [MainTable(nameof(Announcement))]
    public class Announcement : EntityBase
    {
        /// <summary>
        /// 发表人
        /// </summary>
        public long PosterId { get; set; }
        [ForeignKey(nameof(PosterId))]
        public virtual User Poster { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 附件
        /// </summary>
        public virtual List<AnnouncementAttach> Attaches { get; set; }
    }
}

